package com.nginx.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nginx.web.domain.HttpInfoQo;
import com.nginx.web.entity.HttpInfo;
import com.nginx.web.mapper.HttpInfoMapper;
import com.nginx.web.service.HttpInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lyc
 * @since 2025-01-15
 */
@Service
public class HttpInfoServiceImpl extends ServiceImpl<HttpInfoMapper, HttpInfo> implements HttpInfoService {

    public Page<HttpInfo> listHttpInfo(HttpInfoQo qo) {
        Page<HttpInfo> page = new Page<>(qo.getPage() , qo.getLimit());
        LambdaQueryWrapper<HttpInfo> wrapper = Wrappers.lambdaQuery(HttpInfo.class)
                .eq(HttpInfo::getConfInfoId, qo.getConfInfoId());
        page(page , wrapper);
        return page;
    }

    public void updateHttpInfo(HttpInfo httpInfo) {
        updateById(httpInfo);
    }
}
